from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    VehicleRecognizeView, VehicleSubmitView, VehicleImageAuditView, VehicleAuditView,
    VehicleViewSet, VehicleImageViewSet, VehicleViolationViewSet
)

# 创建路由器并注册ViewSet
router = DefaultRouter()
router.register(r'vehicles', VehicleViewSet, basename='vehicle')
router.register(r'vehicle-images', VehicleImageViewSet, basename='vehicle-image')
router.register(r'vehicle-violations', VehicleViolationViewSet, basename='vehicle-violation')

urlpatterns = [
    # 车辆识别和提交接口
    path('vehicle/recognize/', VehicleRecognizeView.as_view(), name='vehicle_recognize'),
    path('vehicle/submit/', VehicleSubmitView.as_view(), name='vehicle_submit'),

    # 审核接口
    path('vehicle/audit/<int:pk>/', VehicleImageAuditView.as_view(), name='vehicle_audit'),
    path('vehicle/status/<int:pk>/', VehicleAuditView.as_view(), name='vehicle_status_audit'),

    # ViewSet路由
    path('', include(router.urls)),
]
router = DefaultRouter()
router.register(r'vehicle-violation', VehicleViolationViewSet)
urlpatterns += router.urls
